using System.CommandLine;
using SumerCoreDevOps.ExecuteNodeApi.Commands;

namespace SumerCoreDevOps.ExecuteNodeApi;

/// <summary>
/// 命令行入口
/// </summary>
public class CommandLineInterface
{
    /// <summary>
    /// 运行命令行
    /// </summary>
    public static async Task<int> RunAsync(string[] args)
    {
        var rootCommand = new RootCommand("SumerCore DevOps 执行节点");

        // 添加 register 命令
        rootCommand.AddCommand(RegisterCommand.CreateCommand());

        return await rootCommand.InvokeAsync(args);
    }
}
